
       /**
	    * A field is considered valid if less than the specified maximum.
	    * Fields are not checked if they are disabled.
	    * <p>
	    *
		* Required javascript: createCampos, validMaxLength
		*
	    * <strong>Caution:</strong> Using <code>validateMaxLength</code> on a password field in a 
	    *  login page gives unnecessary information away to hackers. While it only slightly
	    *  weakens security, we suggest using it only when modifying a password.</p>
	    * @param form The form validation is taking place on.
	    */
	    function validateMaxLength(form) {
	        var isValid = true;
	        var focusField = null;
	        var i = 0;
	        var fields = new Array();
	        var formName = form.getAttributeNode("name"); 
	
	        oMaxLength = eval('new ' + formName.value + '_maxlength()');        
	        for (x in oMaxLength) {
	            var iMax = parseInt(oMaxLength[x][2]("maxlength"));
	            var field = form[oMaxLength[x][0]];
	            var valores = createCampos(field);
	            
	            for (j=0;j<valores.length; j++){
	                var value = valores[j].valor;
	                var f = valores[j].campo;
	                if (!validMaxLength(value, iMax)){
	                    if (i == 0) {
	                        focusField = f;
	                    }
	                    fields[i++] = oMaxLength[x][1];
	                    isValid = false;
	                }
	            }
		    }
	        if (fields.length > 0) {
	        
	           setFocus(focusField);
	           alerte(fields);
	        }
	        return isValid;
	    }